package com.lyl.cloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RefreshScope
public class TestController {
    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String port;

    @GetMapping("/getConfigInfo")
    public Object getConfigInfo() {
        return new HashMap<String,Object>(){{
            put("端口号",port);
            put("配置信息",configInfo);
        }};
    }
}
